 function editable_drop_down(evt,obj){
    myEvt(evt,obj,function(){arrow.className='icon-circle-arrow-down';});
	var list_box=obj.getElementsByTagName('ul')[0].getElementsByTagName('li');
	var arrow=obj.parentNode.getElementsByTagName('table')[0].getElementsByTagName('i')[0];
	var inpObj=(evtObj(evt).nodeName=='input')?(evtObj(evt)):(obj.parentNode.getElementsByTagName('table')[0].tBodies[0].rows[0].cells[0].childNodes[1]);	
    toggle(obj.id,function(){obj.show();arrow.className='icon-circle-arrow-up';},function(){obj.hide();arrow.className='icon-circle-arrow-down';});
    for(var i=0;i<list_box.length;i++){
		list_box[i].firstChild.onclick=function(){
			inpObj.value=this.innerHTML;
			inpObj.previousSibling.value=this.id;
			toggle(obj.id,function(){obj.show();arrow.className='icon-circle-arrow-up';},function(){obj.hide();arrow.className='icon-circle-arrow-down';});
			if(isDefined(editable_drop_down_onSelect)) editable_drop_down_onSelect(obj);
		};
	}
inpObj.onkeyup=function(){
	if(isDefined(getObj(this.previousSibling.value))) getObj(this.previousSibling.value).innerHTML=this.value;
};

inpObj.onchange=function(){
	if(isDefined(editable_drop_down_onChange)) editable_drop_down_onChange(obj,this);
};
}
 
 function editable_drop_down_onSelect(o){
	 if(["type_list_box","make_list_box"].in_array(o.id)){
		 var typeID,makeID,obj=getObj('model_list_box').getElementsByTagName('ul')[0];
		 typeID=getObj('type_list_box').parentNode.getElementsByTagName('table')[0].tBodies[0].rows[0].cells[0].childNodes[1].previousSibling.value.split(":")[1];
		 makeID=getObj('make_list_box').parentNode.getElementsByTagName('table')[0].tBodies[0].rows[0].cells[0].childNodes[1].previousSibling.value.split(":")[1];
		 getObj('model_list_box').parentNode.getElementsByTagName('table')[0].tBodies[0].rows[0].cells[0].childNodes[1].value='';
		 thread(['add/model.php',"typeID="+typeID+"&makeID="+makeID],function(){
		 },function(e){
			 obj.innerHTML='';
			 var arr=eval(e.responseText);
			 for(var i=0;i<arr.length;i++){
			 obj.innerHTML +="<li><a href='javascript:void(0)' id='"+arr[i]+"'>"+arr[i].split(":")[0]+"</a></li>";
			 }
		 },function(){});
		  }
 }
 
 function editable_drop_down_onChange(obj,o){
	  thread(['view/editable_dropdown.php',[obj.id.split("_")[0],o.previousSibling.value.split(":")[1],o.value].ajax_params()],function(){
	 },function(e){
		 //alert(e.responseText);
		if (e.responseText !=0) getObj('is_altered').value=1;
	 },function(){});
	}